home *** CD-ROM | disk | FTP | other *** search
- Path: peachy.apana.org.au!grahamb
- From: grahamb@peachy.apana.org.au (Graham Broadbridge)
- Newsgroups: comp.lang.c
- Subject: Re: Leap Years
- Date: 11 Mar 1996 09:39:48 GMT
- Organization: The Peachy Linux Node!
- Message-ID: <4i0sd4$7lr@peachy.apana.org.au>
- References: <8BA8405.02C70020E1.uuout@sourcebbs.com> <4h6ara$mu@netnews1.apci.com> <825684095snz@genesis.demon.co.uk>
- NNTP-Posting-Host: peachy.apana.org.au
- X-Newsreader: TIN [version 1.2 PL2]
-
- Lawrence Kirby (fred@genesis.demon.co.uk) wrote:
- : In article <4h6ara$mu@netnews1.apci.com> wardmw@apci.com "Martin Ward" writes:
-
- : >david.mohorn@sourcebbs.com (DAVID MOHORN) typed:
- : >
- : >>How do you feature out leap years? If its evenly divisible by 400 and
- : >>4?
-
- I can't believe that anyone here can get confused about this.
-
- isleap(int year)
- {
- if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
- printf("%d is a leap year", year);
- else
- printf("%d is not a leap year", year);
- }
-
- --
- +----------------------------------------------------------------------------+
- Graham Broadbridge Internet <grahamb@peachy.apana.org.au>
- Marsfield NSW <vk2yui@amsat.org>
- Australia amprnet <vk2yui@gw.vk2yui.ampr.org>
- +----------------------------------------------------------------------------+
-